<html>
<head><meta charset="utf-8"><title>tricky merge conflicts · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tricky.20merge.20conflicts.html">tricky merge conflicts</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229043693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tricky%20merge%20conflicts/near/229043693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tricky.20merge.20conflicts.html#229043693">(Mar 05 2021 at 23:47)</a>:</h4>
<p>I'm working on PR <a href="https://github.com/rust-lang/rust/issues/82815">#82815</a>, which involves <em>a lot</em> of small tedious changes. Unfortunately, at the same time someone was working (<a href="https://github.com/rust-lang/rust/issues/82088">#82088</a>) on splitting up one of the main files my PR touches, and I've ended up with massive conflicts. The approach I'm taking to fix the conflicts is to accept all the upstream changes and then manually reapply my changes. But this is frustrating since there's a lot of tedious changes that must be reapplied and it's easy to miss stuff.</p>
<p>Does anyone have tips on how to make this process easier? Like, is there a flag I can pass to <code>git rebase</code> that will make it smarter about moved lines (something like <code>--color-moved</code> for <code>git diff</code>)?</p>



<a name="229043970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tricky%20merge%20conflicts/near/229043970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tricky.20merge.20conflicts.html#229043970">(Mar 05 2021 at 23:50)</a>:</h4>
<p>Hmm, <a href="https://stackoverflow.com/q/3491270">this Stack Overflow question</a> might be helpful.</p>



<a name="229044001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tricky%20merge%20conflicts/near/229044001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tricky.20merge.20conflicts.html#229044001">(Mar 05 2021 at 23:50)</a>:</h4>
<p>I guess the issue is that in my scenario only part of the file was moved...</p>



<a name="229044184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tricky%20merge%20conflicts/near/229044184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tricky.20merge.20conflicts.html#229044184">(Mar 05 2021 at 23:52)</a>:</h4>
<p>(Feel free to ping me if you reply!)</p>



<a name="229913274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tricky%20merge%20conflicts/near/229913274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tricky.20merge.20conflicts.html#229913274">(Mar 11 2021 at 19:44)</a>:</h4>
<p>Yeah, whole file moves should be detected automatically. For partial moves maybe lowering the rename threshold could help. So could using a 3way conflict resolution tool, e.g. kdiff3. if you rebase multiple commits which face the same conflict over and over then you could enable rerere.</p>



<a name="229913780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tricky%20merge%20conflicts/near/229913780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tricky.20merge.20conflicts.html#229913780">(Mar 11 2021 at 19:48)</a>:</h4>
<p>Luckily I was able to fix the conflicts without <em>too</em> much hassle, at least compared to <a href="https://github.com/rust-lang/rust/issues/82356">#82356</a> <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> </p>
<p>For this PR it was a lot of tedious changes but thankfully the compiler would error if I made a mistake.</p>
<blockquote>
<p>For partial moves maybe lowering the rename threshold could help.</p>
</blockquote>
<p>Hmm, I wonder if that would work given that IIUC the rename threshold is lowering the threshold for whole file renames, not partial moves.</p>
<blockquote>
<p>if you rebase multiple commits which face the same conflict over and over then you could enable rerere.</p>
</blockquote>
<p>I've never heard of that, I'll look into it, thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>